package com.hdl.dao.impl;

import java.util.List;

import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import com.hdl.dao.MallCommentDao;
import com.hdl.entity.MallComment;
import com.hdl.util.Druidutils;

public class MallCommentDaoImpl implements MallCommentDao{

	private JdbcTemplate template = new JdbcTemplate(Druidutils.getDataSource());
	
	@Override
	public List<MallComment> findCommentById(String id) {
		
		//定义sql语句
		String sql = "select * from MALL_COMMENT WHERE MALL_PRODUCT_ID = ? ";
		
		return template.query(sql, new BeanPropertyRowMapper<MallComment>(MallComment.class),id);
	}

}
